﻿using System.Web.Mvc;

namespace Ec_System.WebUI.Areas.Web
{
    public class WebAreaRegistration : AreaRegistration 
    {
        public override string AreaName 
        {
            get 
            {
                return "Web";
            }
        }

        public override void RegisterArea(AreaRegistrationContext context) 
        {
            //根据商品ID进入商品详情
            context.MapRoute(
                "ProductInfo",
                "Item/{productID}",
                new { controller = "ShopProduct", action = "ProductInfo"},
                new string[] { "Ec_System.WebUI.Areas.Web.Controllers" }
                );

            //产品分类
            context.MapRoute(
                "ProductClass",
                "ProductClass/{class1}-{class2}-{class3}",
                new {controller = "Search", action = "ProductSearchBySearch", class1 = 0, class2 = 0, class3 = 0 },
                new string[] { "Ec_System.WebUI.Areas.Web.Controllers" }
                );

            //品牌产品列表
            context.MapRoute(
                "Manufacturer",
                "Manufacturer/{action}/{mID}/{pageIndex}",
                new { controller = "Manufacturer", action = "Index", mID = UrlParameter.Optional, pageIndex = UrlParameter.Optional },
                new string[] { "Ec_System.WebUI.Areas.Web.Controllers" }
                );

            //默认
            context.MapRoute(
                "Web_default",
                "Web/{controller}/{action}/{id}",
                new { action = "Index", controller = "Home", id = UrlParameter.Optional },
                new string[] { "Ec_System.WebUI.Areas.Web.Controllers" }

            );
        }
    }
}